<template>
	<div class="home">
		<div class="list_box" v-for="n in arrayingo" @click="toinfo">
			<div class="img_box">
				<img :src="n.doghead" alt="">
			</div>
			<div class="text_box">
				<div class="every_text color_title">{{n.name}}
					<div class="gender">
						<img src="../../myimg/boy.png" v-if="n.gender == 1" alt="">
						<img src="../../myimg/girl.png" v-if="n.gender == 2" alt="">
					</div>
				</div>
				<div class="every_text border_year">{{n.age}}</div>
				<div class="every_text">{{n.dsc}}</div>
				<div class="every_text">
					<div class="icon_add">
						<img src="../../myimg/adres.png" alt="">
					</div>
					<div class="adres_text">
						{{n.addressinfo}}

					</div>
				</div>
			</div>
		</div>
	</div>
</template>
<script>
	export default {
		props: {
			arrayingo: {
				type: Array,
				default: []
			}
		},
		components: {

		},
		data() {
			return {
				
			}
		},
		methods: {
			toinfo() {
				if (localStorage.getItem('type') == "1") {
					uni.navigateTo({
						url: '../le_file/lossinfo',
					});
				}
				
			}
		},
		watch: {},

		onReachBottom() { //页面上拉触底事件的处理函数

		},
		onPullDownRefresh() { //监听用户下拉动作，一般用于下拉刷新
			//需要在 pages.json 里，找到的当前页面的pages节点，并在 style 选项中开启 enablePullDownRefresh
			//uni.startPullDownRefresh(); 开启
			// uni.stopPullDownRefresh(); 关闭
		},
		onUnload() { //监听页面卸载

		},
		onHide() { //监听页面隐藏

		},
		onLoad() { // 替代 created 监听页面加载，其参数为上个页面传递的数据，参数类型为Object（用于页面传参），参考示例

		},
		onReady() { //替代 mounted 监听页面初次渲染完成
			console.log(123)
			// switch (localStorage.getItem('type')) {
			// 	case "1":
			// 		console.log(1111)
			// }
		},

		onShow() { //监听页面显示
			//生命周期
		}
	}
</script>
<style scoped>
	.home {
		width: 100%;
		height: 100%;

	}

	.list_box {
		width: 96%;
		height: 33vw;
		margin-left: 3%;
		margin-top: 10px;
		border-bottom: 1px solid #ededed;
	}

	.img_box {
		width: 30vw;
		height: 30vw;
		float: left;
		margin-left: 2vw;
		position: absolute;
	}

	img {
		width: 100%;
		height: 100%;

	}

	.every_text {
		width: 100%;
		height: 5vw;
		line-height: 5vw;
		color: gray;
		font-size: 10upx;
		margin-top: 2.3vw;
		overflow: hidden;
	}

	.text_box {
		width: 50vw;
		height: 30vw;
		float: left;
		margin-left: 37vw;
	}

	.gender {
		width: 4vw;
		height: 4vw;
		float: right;
		margin-top: 1vw;
		margin-right: 30vw;
	}

	.color_title {
		color: black;
		font-weight: bold;
	}

	.border_year {
		width: 35%;
		color: #d4237a;
		border: 1px solid #d4237a;
		text-align: center;
		border-radius: 5px;
	}

	.icon_add {
		width: 4vw;
		height: 4vw;
		float: left;
	}

	.adres_text {
		width: 95%;
		height: 100%;
		margin-left: 20px;
	}
</style>
